
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Browser-friendly enhanced path
fully compatible with standard node.js
path
A lightweight, cross-platform library for manipulating paths.
This package modifies and enhances the standard path
from node.js
import { Path } from 'path.js';
// Default constructor with optional string or object parameter
const myPath = new Path('custom_separator'); // String: sets custom path separator
const myPathWithOptions = new Path({
sep: 'custom_separator', // Custom path separator
delimiter: 'custom_delimiter', // Custom path delimiter
splitPathReStr: 'custom_regular_expression', // Custom regular expression for splitting paths
});
Properties
Methods
import { WinPath } from 'path.js';
import path from 'path.js';
// path.win32
const winPath = new WinPath();
import { PosixPath } from 'path.js';
import path from 'path.js';
// path.posix
const posixPath = new PosixPath();
import { Path, WinPath, PosixPath } from 'path.js';
import path from 'path.js';
// Using the default Path class
const _path = new Path();
console.log(_path.normalize('/path/to/../file.ext')); // '/path/file.ext'
// Using the WinPath subclass or path.win32
const winPath = new WinPath();
console.log(winPath.normalize('C:\\path\\to\\..\\file.ext')); // 'C:\path\file.ext'
// Using the PosixPath subclass or path.posix
const posixPath = new PosixPath();
console.log(posixPath.normalize('/path/to/../file.ext')); // '/path/file.ext'
FAQs
Browser-friendly enhanced path fully compatible with standard node.js
The npm package path.js receives a total of 9,048 weekly downloads. As such, path.js popularity was classified as popular.
We found that path.js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.